package com.hackerrank.challenges.detecttheemailaddresses;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Solution {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		in.nextLine();
		Set<String> ea = new HashSet<String>();
		for(int i = 0; i < N; i++) {
			String s = in.nextLine();
			Matcher m = Pattern.compile("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)+").matcher(s);
			while (m.find())
				ea.add(m.group());
		}
		String eaa[] = new String[ea.size()];
		eaa = ea.toArray(eaa);
		Arrays.sort(eaa);
		if(eaa.length > 0) {
			System.out.print(eaa[0]);
			for(int i = 1; i < eaa.length; i++)
				System.out.print(";" + eaa[i]);
			System.out.println();
		}
	}
}
